home *** CD-ROM | disk | FTP | other *** search
/ Windows News 2010 Summer - Disc 1 / WN_Ete2010_CD1.iso / Onglet5 / Weezo / Weezo setup.exe / {code_appDir} / www / res / explorer / music1 / config.php < prev    next >
PHP Script  |  2010-05-19  |  8KB  |  181 lines

  1. <?php
  2. /**
  3.  * Music explorer configuration file
  4.  *
  5.  * Configuration of music explorer resource
  6.  * this script is included by /res/administration/std/resourceConfig.php
  7.  * this script should never be directly called.
  8.  *
  9.  * resourceConfig.php sets 2 variables :
  10.  * $resourceData (array) which contains resource parameters loaded from user.res file
  11.  * $_ENV['configurationEnvironment'] which indicates if resourceConfig.php has been called from browser ('browser')
  12.  * or from application's embeded browser ('application')
  13.  *
  14.  * PHP version 5
  15.  *
  16.  * LICENSE: This source file is subject to version 3.0 of the PHP license
  17.  * that is available through the world-wide-web at the following URI:
  18.  * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
  19.  * the PHP License and are unable to obtain it through the web, please
  20.  * send a note to license@php.net so we can mail you a copy immediately.
  21.  *
  22.  * @category   NA
  23.  * @package    NA
  24.  * @author     Nicolas Bruley / Peer 2 World <contact@weezo.net>
  25.  * @copyright  2005-2009 Nicolas Bruley / Peer 2 World
  26.  * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
  27.  * @version    CVS: $Id:$
  28.  * @link       http://www.weezo.net
  29.  * @since      File available since Release 1.0.0
  30.  */
  31.  
  32. require_once(INCLUDE_DIR.'resourceConfigFunctions.php');
  33. require_once(INCLUDE_DIR.'outputFunctions.php');
  34.  
  35. /*
  36.  ***************************************************************************************************************************
  37.  * Verify config rights
  38.  ***************************************************************************************************************************
  39.  */
  40. $limitedConfig=rcConfigRights(true);
  41.  
  42. /*
  43.  ***************************************************************************************************************************
  44.  * Display configuration form
  45.  ***************************************************************************************************************************
  46.  */
  47.  
  48. // Insert Javascript function needed for save button activation, and <form> with hidden fields.
  49. rcInsertScriptAndForm();
  50.  
  51. // Resource icon & name
  52. rcInsertIconName($resourceData);
  53.  
  54. /**
  55.  * Shared folder or items
  56.  */
  57. $defaultDir=(cfGGetVar('specialFolderMyMusic'))?cfGGetVar('specialFolderMyMusic'):cfAppSharedDir();
  58. rcSharedFilesBox('audio',$defaultDir);
  59.  
  60.  
  61. /*  Advanced config section
  62.     vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv*/
  63. rcAdvancedConfigStart();
  64.  
  65. if(!$limitedConfig){
  66.     // Download shortcut
  67.     rcProcessData('downloadShortcut',dataBoolean,true,false,cfCaption('explorerDownloadShortcut'), false);
  68.     echo outHelpButton('helpSDL').'<br/>';
  69.     // Multiple download
  70.     rcProcessData('multipleDownloadAllowed',dataBoolean,true,false,cfCaption('configAllowMultipleDownload'),false);
  71.     echo outHelpButton('helpMD').'<br/>';
  72.  
  73.     echo '<br>';
  74.  
  75.     // File view (image, audio,...)
  76.     rcProcessData('fileViewAllowed',dataBoolean,true,false,false); // Allow/forbid user to listen to audio files
  77.  
  78.     // File access parameters (apply to files and folders located in "path")
  79.     rcProcessData('downloadAllowed',dataBoolean,true,false,false/*do not display control*/); // Allow/forbid read access to files and folders
  80.     rcProcessData('writeAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid write access to files and folders
  81.     rcProcessData('modifyAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid modifcation access to files and folders (need writeAllowed to true)
  82.     rcProcessData('executeAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid execute access to files
  83.     rcProcessData('uploadAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid file upload
  84.     rcProcessData('remoteDownloadAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid remote download of files
  85.  
  86.     rcProcessData('userTempDirAccessAllowed',dataBoolean,false,false,false/*do not display control*/); // Allow/forbid access to user temp directory (data/sessiondata/(session_id)/)
  87.     rcProcessData('resourceDataDirAccessAllowed',dataBoolean,true,false,false/*do not display control*/); // Allow/forbid access to resource directory (data/res/(res type)/(res subType)/(res file name)/)
  88. }
  89. echo '<div class="frame2">';
  90. // Default audio player
  91. echo '<b>'.cfCaption('musicCfgDefaultPlayer').'</b>';
  92.  
  93. echo outDivFrame('frame3');
  94. echo '<table id="table"><tr><td style="padding-left:12px;width:50%">';
  95. rcProcessData('audioPlayer',dataList,'flash',array('qt','wmp','flash','external'),array(
  96.     array(false,'flash',array(outIcon('flash'),cfCaption('musicCfgFlash').'</td><td>')),
  97.     array(false,'qt',array(outIcon('qt'),'Quicktime'.'</td></tr><tr><td>')),
  98.     array(false,'wmp',array(outIcon('wmp'),cfCaption('musicCfgEmbeded').'</td><td>')),
  99.     array(false,'external',array(rcResourceImage('external.gif'),cfCaption('musicCfgExternal').'</td></tr>'))));
  100. echo '</table></div>';
  101.  
  102. echo '<b>'.cfCaption('musicPlayerPosition').'</b><br/>';
  103. rcProcessData('inlinePlayer',dataBoolean,true,false,array(cfCaption('musicInlinePlayer'),cfCaption('musicPopupPlayer')));
  104.  
  105. // Maximum output bit rate
  106. if(!$limitedConfig){
  107.     echo '<br/>';
  108.     rcProcessData('maxOutputBitRate',dataList,'original',array('original','128','64','32'),array(
  109.     array(rcResourceImage('cfgMaxBitrate.png'),cfCaption('musicCfgMaxBr')),array(
  110.     array('original',cfCaption('musicCfgNoLimit')),
  111.     array('128',cfCaption('explorerAudio128')),
  112.     array('64',cfCaption('explorerAudio64')),
  113.     array('32',cfCaption('explorerAudio32'))),false), false);
  114.     echo outHelpButton('helpAudioMaxBR');
  115. }
  116. echo '</div>';
  117.  
  118. rcProcessData('flashPlayerBufferLength',dataNumeric,3,false,false/*do not display control*/); // Default buffer time for flash audio player (seconds)
  119. rcProcessData('flashPlayerDefaultVolume',dataNumeric,70,false,false/*do not display control*/); // Default audio volume for flash audio player (percent)
  120.  
  121. rcProcessData('sortField',dataList,'no',array('no','artist','album','artistAlbum'),array(
  122. array(cfCaption('genGroupBy')),array(
  123. array('no',cfCaption('genNoGroup')),
  124. array('artist',cfCaption('explorerAudioArtist')),
  125. array('album',cfCaption('explorerAudioAlbum')),
  126. array('artistAlbum',cfCaption('explorerAudioArtist').'/'.cfCaption('explorerAudioAlbum'))),false));
  127.  
  128. // Layout
  129. rcProcessData('filesLayout',dataText,'resource',false,false/*do not display control*/); // Default files layout: resource specific */
  130. rcProcessData('filesLayoutLocked',dataBoolean,false,false,false/*do not display control*/); // Do not lock files layout (allow user to change) */
  131.  
  132. // Theme
  133. echo rcThemeSelectionControl();
  134.  
  135. // Save / cancel buttons
  136. echo rcButtonSaveCancel();
  137.  
  138. // If resource need access to resource data dir, create it
  139. rcCreateResourceDataDir();
  140.  
  141. // Indicate that resource has been initialized
  142. rcProcessData('resourceConfigured',dataBoolean,true,false,false/*do not display control*/);
  143.  
  144. // Save parameters
  145. rcWriteResourceFile($resourceData, $fileName);
  146. ?>
  147. <script language="javascript" type="text/javascript">
  148. function dataChanged(dataName,dataValue){
  149.     if(dataName=="audioPlayer"){
  150.         if(dataValue!='flash') {
  151.             //if(dataValue=='external') document.getElementsByName('inlinePlayer')[0].checked='checked';
  152.             document.getElementsByName('inlinePlayer')[1].checked='checked';
  153.             document.getElementsByName('inlinePlayer')[0].disabled=true;
  154.             document.getElementsByName('inlinePlayer')[1].disabled=true;
  155.         }
  156.         else{
  157.             document.getElementsByName('inlinePlayer')[0].disabled=false;
  158.             document.getElementsByName('inlinePlayer')[1].disabled=false;
  159.         }
  160.     }
  161.     if(dataName=="inlinePlayer"){
  162.         if(dataValue==true){
  163.             document.getElementsByName("audioPlayer")[0].disabled=true;
  164.             document.getElementsByName("audioPlayer")[0].checked='checked';
  165.             document.getElementsByName("audioPlayer")[1].disabled=true;
  166.             document.getElementsByName("audioPlayer")[2].disabled=true;
  167.             document.getElementsByName("audioPlayer")[3].disabled=true;
  168.         }
  169.         else{
  170.             document.getElementsByName("audioPlayer")[0].disabled=false;
  171.             document.getElementsByName("audioPlayer")[1].disabled=false;
  172.             document.getElementsByName("audioPlayer")[2].disabled=false;
  173.             document.getElementsByName("audioPlayer")[3].disabled=false;
  174.         }
  175.     }
  176. }
  177. function dataInitForm(){
  178.     dataChangedNV("audioPlayer");
  179. }
  180. dataInitForm();
  181. </script>